<?php

/**
 * FrontpageSlider form.
 *
 * @package    tsantek-shop
 * @subpackage form
 * @author     Tomislav Šantek
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class FrontpageSliderForm extends BaseFrontpageSliderForm
{
  public function configure()
  {
      unset(
              $this['slug'],
              $this['created_at'],
              $this['updated_at']
              );
    $this->setWidget('pic_path', new sfWidgetFormInputFileEditable(array(
            'file_src'    => '/uploads/slider/'.$this->getObject()->pic_path,
            'edit_mode'   => !$this->isNew(),
            'is_image'    => true,
            'with_delete' => false,
      )));

    $this->setValidator('pic_path', new sfValidatorFile(array(
                    'mime_types' => 'web_images',
                    'path' => sfConfig::get('sf_upload_dir') . '/slider',
                    'required' => false,
            )));
  }
}
